﻿using HardcoreGame.Common.CustomSets;
using HardcoreGame.Content.Items.Weapons.Ranged.Guns;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;

namespace HardcoreGame.Common.GlobalItems
{
    public class ToolTipItem : GlobalItem
    {
        public override bool InstancePerEntity => true;
        protected override bool CloneNewInstances => true;
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            if (CustomItemSets.AcidWeapon[item.type])
            {
                TooltipLine acidTip = new(Mod, "AcidWeapon", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Acid"))
                {
                    OverrideColor = Color.LimeGreen
                };
                tooltips.Insert(1, acidTip);
            }
            if (CustomItemSets.HeavyWeapon[item.type])
            {
                TooltipLine acidTip = new(Mod, "HeavyWeapon", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Heavy"))
                {
                    OverrideColor = Color.MediumOrchid
                };
                tooltips.Insert(1, acidTip);
            }
            if (item.type == ItemID.PhoenixBlaster)
            {
                TooltipLine acidTip1 = new(Mod, "FrostConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Frost"))
                {
                    OverrideColor = Color.MediumOrchid
                };
                tooltips.Add(acidTip1);
            }
            if (item.type == ModContent.ItemType<FrostBurstBlaster>())
            {
                TooltipLine acidTip1 = new(Mod, "PhoenixConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Phoenix"))
                {
                    OverrideColor = Color.MediumOrchid
                };
                tooltips.Add(acidTip1);
            }
            if (item.type == ItemID.FlintlockPistol)
            {
                TooltipLine acidTip1 = new(Mod, "AcidConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Acida"))
                {
                    OverrideColor = Color.LimeGreen
                };
                tooltips.Add(acidTip1);
            }
            if (item.type == ItemID.PlatinumBow)
            {
                TooltipLine acidTip1 = new(Mod, "AcidConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Acidb"))
                {
                    OverrideColor = Color.LimeGreen
                };
                tooltips.Add(acidTip1);
            }
            if (item.type == ItemID.Spear)
            {
                TooltipLine acidTip1 = new(Mod, "AcidConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Acidc"))
                {
                    OverrideColor = Color.LimeGreen
                };
                tooltips.Add(acidTip1);
            }
            if (item.type == ItemID.AquaScepter)
            {
                TooltipLine acidTip1 = new(Mod, "AcidConversion", Language.GetTextValue("Mods.HardcoreGame.ToolTip.Acidd"))
                {
                    OverrideColor = Color.LimeGreen
                };
                tooltips.Add(acidTip1);
            }
        }
    }
}
